import { computed, reactive, ref } from 'vue'
import themeStore from '../store/module-theme'

// 主题相关逻辑
export const useCommonThemeEffect = () => {
  const themeList = reactive([
    {
      text: '石基蓝',
      value: 'shiji'
    },
    {
      text: '黑色',
      value: 'black'
    },
  ])

  const themeStoreM =themeStore()
  let currentTheme = computed(()=>{
    return themeStoreM.getTheme
  })

  let navigationBar = computed(()=>{
    return themeStoreM.navigationBar
  })

  let tabBar = computed(()=>{
    return themeStoreM.tabBar
  })


  function changeTheme(e: string) {
    themeStoreM.setTheme(e)
    // uni.setTabBarStyle(themeStoreM.tabBar)
    // uni.setNavigationBarColor(themeStoreM.navigationBar)
  }
  return { themeList, currentTheme, changeTheme, navigationBar, tabBar }
}
